package com.weiz.domain.excel;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Person {
    @ExcelProperty("姓名")
    private String name;
    @ExcelProperty("年龄")
    private Integer age;

//    @ExcelProperty("入职日期")
//    @DateTimeFormat("yyyy-MM-dd")
//    @JsonFormat(pattern = "yyyy-MM-dd")
//    private Date jobDate;

    // 使用自定义转换器去掉时分秒
    @ExcelProperty(value="入职日期",converter = DateOnlyConverter.class)
    private Date jobDate;

}